<template>
  <div>
    <TypeNov></TypeNov>
    <ListContainer></ListContainer>
    <TodayRecommend></TodayRecommend>
    <rank></rank>
    <like></like>
    <floor v-for="floor in reqfloor" :key="floor.id" :floorlist="floor"></floor>
    <brand></brand>
  </div>
</template>

<script>
import ListContainer from "./ListContainer/index.vue";
import TodayRecommend from "./TodayRecommend/index.vue";
import rank from "./rank/index.vue";
import like from "./like/index.vue";
import floor from "./floor/index.vue";
import brand from "./brand/index.vue";
import { mapState } from "vuex";

export default {
  name: "Home",
  components: { ListContainer, TodayRecommend, rank, like, floor, brand },
  mounted() {
    this.$store.dispatch("reqfloor"); //派发actions的函数，触发获取请求，之后放在vuex里面
  },
  computed: {
    ...mapState({
      reqfloor: (state) => {
        return state.floor.floordata;
      },
    }),
  },
};
</script>

<style lang="less" scoped>
</style> 